﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace TestingWP7
{
    public partial class ListBoxTesting : PhoneApplicationPage
    {
        public ListBoxTesting()
        {
            InitializeComponent();
        }

        private void tbGotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            textBox.Text = "";
			textBox.Foreground = new SolidColorBrush(Color.FromArgb(255,0,0,0));
        }

        private void tbLostFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            textBox.Text = "Search";
			textBox.Foreground = new SolidColorBrush(Color.FromArgb(255,127,127,127)) ;
        }

        private void lbCategories_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
        }

        private void lbCategories_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
        	if (lbCategories.SelectedIndex == -1)
        		return;
			NavigationService.Navigate(new Uri("/NearByPage.xaml?selectedItem=" + lbCategories.SelectedIndex, UriKind.Relative));

    		lbCategories.SelectedIndex = -1;
        }


 
    }
}